package fr.uniscol.dao.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import fr.uniscol.model.BaseAnneeScolaire;
import fr.uniscol.model.Classe;

public class ClasseRowMapper implements RowMapper<Classe> {

	private BaseAnneeScolaire base = null;
	
	public ClasseRowMapper(){
	}
	
	public ClasseRowMapper(BaseAnneeScolaire base){
		this.base = base;
	}
	
	@Override
	public Classe mapRow(ResultSet rs, int rownum) throws SQLException {
		
		Classe classe = new Classe();
		classe.setId(rs.getInt("STRUCTUREID"));
		classe.setLibelle(rs.getString("LIBELLE"));
		classe.setCodeStructure(rs.getString("ID_SIECLE"));
		classe.setBase(this.base);
		
		return classe;
	}
}
